1. Field of the Invention
The present invention relates to a microcomputer including a watch-dog timer and a sleep control timer.
2. Description of Related Art
A watch-dog timer, which supervises a CPU operated based on an operation clock generated by a main oscillation circuit, is disclosed in JP-A-2001-5695. Further, an information processing apparatus, which includes a sleep control timer for counting a time interval in order to recover a controller from a sleep mode to a normal operation mode, is disclosed in JP-A-H9-6489.
FIG. 4 shows an example of proposed configuration of a watch-dog timer and a sleep control timer. A watch-dog timer 1 is used as an abnormality detection circuit for a CPU (not shown). In the watch-dog timer 1, a counter 3 is provided for counting a sub-clock CK generated by a sub-clock oscillation circuit 2. A comparator 5 outputs a reset signal RST when a count value of the counter 3 exceeds a set value of a register 4. The CPU needs to output a clear signal CLR to the counter 3 within a predetermined supervisory time. Accordingly, no outputting of the reset signal RST means that the CPU performs a clear signal output routine without trouble.
To the contrary, while the CPU does not need to be operated, a main clock is stopped and a CPU mode changes to a low power-consumption mode (sleep mode) for reducing power consumption of a microcomputer. Once the CPU mode changes to the sleep mode, the CPU mode recovers to the normal operation mode when an interrupt signal is inputted from an external device or a predetermined sleep time passes. A sleep control timer 6 includes a counter 7 for counting the sub-clock CK. A comparator 9 outputs a wake-up signal WKUP when a count value of the counter 7 exceeds a set value of a register 8.
The watch-dog timer 1 and the sleep control timer 6 are widely used in an area of microcomputer. However, they are configured separately because their functions are quite different. Specifically, no circuit is integrated except for sharing the sub-clock CK. Recently, great efforts are made to further raise function of microcomputer. In this situation, increase of chip area causes problems such as high cost. Therefore, it is important to reduce circuit size of a microcomputer.